<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/website/common/base.jsp"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>${webname }-采购模板</title>
<%@ include file="/website/common/common.jsp"%>
<link href="${webctx }/css/manage.css" rel="stylesheet" type="text/css" />
<link href="${webctx }/css/payment.css" rel="stylesheet" type="text/css" />
<style>
	.rbtn{position:absolute;right:5px;top:6px;}
	.rbtn a{width:100px; height:26px;line-height:26px; border:1px solid #0DAEFF; color:#0DAEFF; display:block; text-align:center; padding:0px;}
	.rbtn a:hover{background:#14ABFC;color:#fff}
	.cgmb{margin-top:-1px;}
	.cgmb ul li{margin:0px;padding:0px;float:left;display:block;border-top:1px solid #DCDCDC;border-bottom:1px solid #DCDCDC;width:24.9%;text-align:center;margin-bottom:12px;}
	.cgmb .coninner{border-left:1px solid #DCDCDC;border-right:1px solid #DCDCDC;margin-left:-1px}
	.cgmb .img{height:225px;}
	.cgmb img{width:225px;height:225px;}
	.cgmb .title{height:34px;line-height:34px;font-size:16px;}
	.cgmb .caoz{height:46px;line-height:46px;}
	.cgmb .caoz .s1{background:url(${webctx}/images/n2.jpg) no-repeat left center;text-indent:20px;display: inline-block;}
	.cgmb .caoz .s2{background:url(${webctx}/images/n1.jpg) no-repeat left center;text-indent:20px;display: inline-block;}
	.cgmb .btn{border-top:1px solid #DCDCDC;margin-top:14px;}
	.cgmb .btn span{display:block;float:left;width:33%;}
	.cgmb .btn span.a1 a{color:#2DB9FF;border-right:1px solid #DCDCDC;width:100%;display:block;padding:8px 0;}
	.cgmb .btn span.a2 a{color:#FF9090;padding:8px 0;display:block;}
</style>
</head>

<body>
<%@ include file="/website/common/top.jsp"%>
<%@ include file="/website/common/head.jsp"%>
<%@ include file="/website/common/menu.jsp"%>

<div class="warp-body">
	<div class="inner clearfix">
    	<div class="left-main">
        	<div class="left-inner">
            	<%@ include file="/website/user/left.jsp"%>
            </div>
        </div>
    	<div class="right-main">
        	<div class="right-inner" style="background-color: #ffffff">
            	<div class="right-title"><span></span>采购模板<label class="rbtn"><a href="javascript:add();">添加采购计划</a></label></div>
            	<div class="cgmb">
            		<ul>
            		<c:forEach var="info" items="${list }">
            		<li id="pid${info.id }">
            			<div class="coninner">
	            			<div class="title">${info.name }</div>
	            			<div class="img">
								<c:if test="${empty info.photo }"><a href="javascript:show(${info.id });"><img src="${webctx}/images/noimg.jpg"></a></c:if>
								<c:if test="${not empty info.photo }"><a href="javascript:show(${info.id });"><img src="<%=getRandomFileserver()%>${info.photo}" onerror="javascript:this.src='${webctx}/images/noimg.jpg'"></a></c:if>
							</div>
	            			 
	            			<div class="caoz"><c:if test="${info.isremind!=1 }"><a class="s1" href="javascript:setremind(${info.id });">设置计划提醒</a></c:if><c:if test="${info.isremind==1 }"><a class="s2" href="javascript:setremind(${info.id });">已设定采购计划提醒</a></c:if></div>
	            			
	            			<div class="btn">
		            			<span class="a1"><a href="javascript:edit(${info.id });">编辑</a></span>
		            			<span class="a1"><a href="javascript:show(${info.id });">查看</a></span>
		            			<span class="a2"><a href="javascript:del(${info.id });">删除</a></span>
	            			</div>
	            			<div class="clear"></div>
            			</div>
            		</li>
            		</c:forEach>
            		</ul>
            		<div class="clear"></div>
            		<c:if test="${list.size()==0 }">
            		<div class="main-txt txt-kong">
		            	<span class="ico-1"></span>
		            	<p>这里什么都没有，去添加采购计划吧！</p>
		            </div>
		            </c:if>
            	</div>
            </div>
        </div>
    </div>
</div>

<%@ include file="/website/common/foot.jsp"%>
</body>
</html>
<script>
var uploader;
$(function(){
	setLeftCur("cgmb");
	
})
function add(){
	window.location.href=ctx+"/purchasetemp/edit";
}
function edit(id){
	window.location.href=ctx+"/purchasetemp/edit?id="+id;
}
function show(id){
	window.location.href=ctx+"/purchasetemp/show?id="+id;
}
function del(id){
	if(confirm("确定要移除本条采购计划？")){
		$w.httpRequest({
			url:apiroot+"/purchasetemp/del",
			data:{"id":id},
			ok:function(ret){
				$("#pid"+id).remove();
			}
		})
	}
}
function setremind(id){
	window.location.href=ctx+"/purchasetemp/remindshow?panid="+id;
}


</script>